#import "Shape.h"

@interface Shape ()
{
    int _color;
    Line *_line;
    Line *_lineCopy;
    Line *_lineRetained;
}
@end

@implementation Shape
- (void)setColor:(int)color {
    _color = color;
}

- (int)color {
    return _color;
}

- (void)setLine:(Line *)line {
    _line = line;
}

- (Line *)line {
    return _line;
}

//1. 了解属性自动生成setter方法和实例变量的过程
//2. 以后可能会自定义setter和getter
- (void)setLineCopy:(Line *)lineCopy {
    [_lineCopy release];
    
    _lineCopy = [lineCopy copy];
}

- (Line *)lineCopy {
    return _lineCopy;
}

- (void)setLineRetained:(Line *)lineRetained {
    [_lineRetained release];
    
    _lineRetained = [lineRetained retain];
}

- (Line *)lineRetained {
    return _lineRetained;
}

- (void)dealloc {
    [_lineCopy release];
    _lineCopy = nil;
    
    NSLog(@"%s", __PRETTY_FUNCTION__);
    
    [super dealloc];
}
@end
